import java.io.FileInputStream;
import java.io.InputStreamReader;

import parser.ProgramParser;
import parser.SyntaxNode;
import parser.SyntaxNodePrinter;
import scanner.Scanner;

public class dwarf_parser_main
{
    public static void main(String arg[])
    {
        try
        {
            InputStreamReader reader = new InputStreamReader(new FileInputStream("infile2.dat"));
            ProgramParser parser = new ProgramParser(new Scanner(reader));

            SyntaxNode syntaxTree = parser.Parse();
            if (!parser.WasError())
            {
                SyntaxNodePrinter printer = new SyntaxNodePrinter();
                printer.PrintSyntaxNode(syntaxTree);
            }

        }
        catch (Exception ex)
        {
            ex.printStackTrace();
        }
    }
}
